/**
* 无线数传测试模块
* 验证上位机和单片机之间的数传能否成功
* 单片机接收到数据后，会回发"successfully write data"以及接收到的数据
*/
String comdata = "";

void setup()
{
    Serial.begin(9600);
    Serial.println("Serial monitor starts successfully!");
}

void loop()
{
  while (Serial.available() > 0)  
  {
      comdata += char(Serial.read());
      delay(2);
  }
  if (comdata.length() > 0)
  {
      Serial.println(comdata);
      Serial.write("successfully write data");
      // Serial.println("successfully write data");
      comdata = "";
  }
}
